<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>项目维护</title>
	<%@ include file="/WEB-INF/include/include.jsp" %>
	<script type="text/javascript" src="<%=path %>/js/rms/vappmgr/vappmgr.js"></script>
  </head>
  <body>
  		<div class="listpage-locked-content">
			<h2 class="listpage-lk-title" >项目维护</h2>
			<div class="listpage-lk-search" id="searchWrap" ></div>
			<div class="listpage-lk-tbar" id="tbarWrap"></div>
		</div>
		
		<div class="listpage-content">
			<div class="listpage-grid" id="gridWrap"></div>
		</div>
		
  </body>
</html>

	<ui:page>

  	<ui:model name="GrildVappModel">
  		 <x:attr name="fields" type="array">
  		
  			<ui:model.field name="VAPP_VDC" ></ui:model.field>
  			<ui:model.field name="VAPP_NAME" ></ui:model.field>
  			<ui:model.field name="VAPP_DESCRIBE"></ui:model.field>
  			<ui:model.field name="VAPP_STATUS" ></ui:model.field>
  	        <ui:model.field name="VAPP_VM"></ui:model.field>
  		
  			<ui:model.field name="VAPP_OWNER"></ui:model.field>
  			<ui:model.field name="VAPP_CPU"></ui:model.field>
  			<ui:model.field name="VAPP_MEMORY"></ui:model.field>
  			<ui:model.field name="VAPP_SIZE"></ui:model.field>
  			
  		</x:attr>
  	</ui:model>
	<ui:toolbar  id="toolbar"  renderTo="tbarWrap" >
		<x:items>
			<ui:button text="启动" iconCls='enable'  handler="VappList.powerOnVapp" scope="VappList"   />
			
			<x:value>-</x:value>
			<ui:button text="挂起" iconCls='disable' handler="VappList.suspendVapp" scope="VappList" />
			<x:value>-</x:value>
			<ui:button text="停止" iconCls='icon-cls' handler="VappList.shutdownVapp" scope="VappList" />
			<x:value>-</x:value>
			<ui:button text="刷新" iconCls='icon-reload' handler="VappList.refreshVapp" scope="VappList" />
			<x:value>-</x:value>
			<ui:button text="主机维护" iconCls='icon-search' handler="VappList.goToVM" scope="VappList" />
			<x:value>-</x:value>
		</x:items>
	</ui:toolbar>
	
	
	
	<ui:grid id="vappGrid" showCheckbox="true"  autoLoad="false"
		datasetName="VappMgrDatasetHandler" 
		handlerName="VappMgrQueryHandler" 
		model="GrildVappModel" renderTo="gridWrap"  >
		<x:columns>
			
		    <ui:gridcolumn text="云中心名称" dataIndex="VAPP_VDC"/>
			<ui:gridcolumn text="名称" dataIndex="VAPP_NAME" />
			<ui:gridcolumn text="描述" dataIndex="VAPP_DESCRIBE" />
			<ui:gridcolumn text="状态" dataIndex="VAPP_STATUS" renderer="VappList.statusRender" />
			<ui:gridcolumn text="主机" dataIndex="VAPP_VM"></ui:gridcolumn>
			<ui:gridcolumn text="所有者 " dataIndex="VAPP_OWNER" />
            <ui:gridcolumn text="处理器" dataIndex="VAPP_CPU" />
            <ui:gridcolumn text="内存 " dataIndex="VAPP_MEMORY" />
            <ui:gridcolumn text="存储(已使用)" dataIndex="VAPP_SIZE" />

		</x:columns>
		<x:listeners>
			<x:handler name="itemdblclick" funcName="VappList.goToVM"></x:handler>
		</x:listeners>
		
	</ui:grid>
	<x:bottomScript> 
	if(VappList.dataset!=undefined)
	Ext.getCmp("vappGrid").getStore().add(VappList.dataset.record);
	</x:bottomScript>
	
	</ui:page>

	
